package bawei.com.bilibili;

import android.graphics.Color;

import android.os.Bundle;


import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;


import android.support.v7.widget.Toolbar;

import com.flyco.tablayout.SlidingTabLayout;

import bawei.com.adapter.AllareasRankPagerAdapter;

import bawei.com.adapter.OriginalRankPagerAdapter;
import bawei.com.widget.NoScrollViewPager;

/**
 * 类描述:
 * 作者：cwm
 * 时间:2017/3/20 08:51
 * 邮箱:18310832074@163.com
 */

public class OriginalRankActivity extends FragmentActivity {

    private String[] titles = new String[] { "原创", "全站", "番剧" };

    private String[] orders = new String[] { "origin-03.json", "origin-03.json", "all-3-33.json" };
    private SlidingTabLayout mSlidingTabLayout;

    private NoScrollViewPager mViewPager;

    private Toolbar mToolbar;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_original_rank);
        mSlidingTabLayout = (SlidingTabLayout) findViewById(R.id.sliding_tabs);
        mViewPager = (NoScrollViewPager) findViewById(R.id.view_pager);
        mToolbar = (Toolbar) findViewById(R.id.toolbar);
        mToolbar.setLogo(R.drawable.action_button_back_pressed_light);
        mToolbar.setTitle("全区排行榜");
        mToolbar.setTitleTextColor(Color.WHITE);
        mToolbar.inflateMenu(R.menu.menu_rank);
        OriginalRankPagerAdapter adapter=new OriginalRankPagerAdapter(getSupportFragmentManager(),titles,orders);
        mViewPager.setAdapter(adapter);
        mSlidingTabLayout.setViewPager(mViewPager);
        mSlidingTabLayout.setTextSelectColor(Color.WHITE);
        mSlidingTabLayout.setTextUnselectColor(Color.GRAY);
        mSlidingTabLayout.setUnderlineColor(Color.WHITE);
    }
}
